package com.oracle.jimu.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.oracle.jimu.bean.Attr;
import com.oracle.jimu.bean.SuperType;
import com.oracle.jimu.service.AttrService;
import com.oracle.jimu.service.SuperTypeService;

public class AttrAction extends ActionSupport implements Preparable{
  private List<Attr> attrList;
  private List<SuperType> superList;
  private Attr attr;
  private Integer attrid;
  private AttrService attrService;
  private SuperTypeService superService;


public List<SuperType> getSuperList() {
	return superList;
}

public void setSuperList(List<SuperType> superList) {
	this.superList = superList;
}

public SuperTypeService getSuperService() {
	return superService;
}

public void setSuperService(SuperTypeService superService) {
	this.superService = superService;
}

/**
 * @return the attrService
 */
public AttrService getAttrService() {
	return attrService;
}

/**
 * @param attrService the attrService to set
 */
public void setAttrService(AttrService attrService) {
	this.attrService = attrService;
}

/**
 * @return the attrid
 */
public Integer getAttrid() {
	return attrid;
}

/**
 * @param attrid the attrid to set
 */
public void setAttrid(Integer attrid) {
	this.attrid = attrid;
}

/**
 * @return the attr
 */
public Attr getAttr() {
	return attr;
}

/**
 * @param attr the attr to set
 */
public void setAttr(Attr attr) {
	this.attr = attr;
}

/**
 * @return the attrList
 */
public List<Attr> getAttrList() {
	return attrList;
}

/**
 * @param attrList the attrList to set
 */
public void setAttrList(List<Attr> attrList) {
	this.attrList = attrList;
}


public String attrList(){
	attrList = attrService.attrList();
	return SUCCESS;
	
}
public String toaddAttr(){
	superList=superService.getSupers();
	return SUCCESS;
}
public String addAttr(){
	attrService.addAttr(attr);
	return SUCCESS;
	
}
public String delAttr(){
	attrService.deleteAttr(attrid);
	return SUCCESS;
}

@Override
public void prepare() throws Exception {
	// TODO Auto-generated method stub
	
}
}
